#ifndef __TERRAIN__
#define __TERRAIN__

#include "GameObject.h"

class Bird;

class Terrain : public GameObject
{
public:
	Terrain();
	~Terrain();

	CREATE_FUNC(Terrain);
	bool init();

	CCSprite* ground1Sprite;
	CCSprite* ground2Sprite;

	float ground1X;
	float ground2X;
	float groundWidth;
	float groundHeight;

	float lastColumnAdded;

	CCArray* columnArray;
	Bird* bird;

	void setCameraX(float x);
	void addColumnRandom(float x);
	void update(float delta);
	void touch();
	void resetGame();

private:
	float cameraX;
	void updateGroundPosition();
};
#endif // !__TERRAIN__
